Skip to content

[Merged by Bors] - feat(Data/Finsupp): support of mapDomain is image of support if nonneg - #43610

Closed
YaelDillies wants to merge 3 commits into
leanprover-community:masterfrom
YaelDillies:support_map_domain_of_nonneg
Closed

[Merged by Bors] - feat(Data/Finsupp): support of mapDomain is image of support if nonneg#43610
YaelDillies wants to merge 3 commits into
leanprover-community:masterfrom
YaelDillies:support_map_domain_of_nonneg

Conversation

@YaelDillies

@YaelDillies YaelDillies commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Also replace MulLeftMono by IsOrderedMonoid in a bunch of lemmas about commutative monoids, since the latter is mathematically equivalent but stronger according to TC search.

Moves

  • Finsupp.mapDomain_apply -> Finsupp.mapDomain_apply_of_injective

to make space for the more general lemma that doesn't assume injectivity.


Open in Gitpod

Also rename `mapDomain_apply` to `mapDomain_apply_of_injective` to make space for the more general lemma that doesn't assume injectivity.
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

PR summary fbf13c9d57

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Algebra.Order.BigOperators.Group.Finset 681 682 +1 (+0.15%)
Mathlib.Data.Finsupp.Order 854 855 +1 (+0.12%)
Import changes for all files
Files Import difference
18 files Mathlib.Algebra.Order.BigOperators.Group.Finset Mathlib.Algebra.Order.Group.Int.Sum Mathlib.Algebra.Order.Ring.GeomSum Mathlib.Combinatorics.Additive.SubsetSum Mathlib.Combinatorics.Colex Mathlib.Combinatorics.Enumerative.Composition Mathlib.Combinatorics.Enumerative.Partition.Basic Mathlib.Combinatorics.SetFamily.KruskalKatona Mathlib.Data.Finsupp.Antidiagonal Mathlib.Data.Finsupp.Interval Mathlib.Data.Finsupp.Lex Mathlib.Data.Finsupp.MonomialOrder Mathlib.Data.Finsupp.Order Mathlib.Data.Finsupp.WellFounded Mathlib.Data.NNRat.BigOperators Mathlib.Data.Set.Equitable Mathlib.Geometry.Group.Growth.QuotientInter Mathlib.Logic.Hydra
1

Declarations diff (regex)

+ mapDomain_apply_of_injective
+ prod_comapDomain
+ support_mapDomain_of_nonneg
- sum_comapDomain

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit fbf13c9).

  • +3 new declarations
  • −0 removed declarations
+Finsupp.mapDomain_apply_of_injective
+Finsupp.prod_comapDomain
+Finsupp.support_mapDomain_of_nonneg

No changes to strong technical debt.
No changes to weak technical debt.

Current commit fbf13c9d57
Reference commit d1298f10ae

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

Comment thread Mathlib/Data/Finsupp/Order.lean
@eric-wieser

Copy link
Copy Markdown
Member

nit: use the "moves" section of the PR template

bors d+

@mathlib-bors mathlib-bors Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Sep 9, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

✌️ YaelDillies can now approve this pull request until 2026-09-23 09:49 UTC (in 2 weeks). To approve and merge, reply with bors r+. More detailed instructions are available here.

⚠️ This delegation only covers changes within Archive/**, Counterexamples/**, docs/**, DownstreamTest/**, Mathlib/**, MathlibTest/**, Wanted/**, widget/**, Archive.lean, Counterexamples.lean, docs.lean, Mathlib.lean, Wanted.lean; an author commit touching anything else will revoke it. Bors also revokes it if a later push changes too many files for it to check the full list — even if it stays within scope.

Comment thread Mathlib/Algebra/Order/BigOperators/Group/Finset.lean
@YaelDillies

Copy link
Copy Markdown
Contributor Author

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Sep 9, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
…neg (#43610)

## Moves

- `Finsupp.mapDomain_apply` -> `Finsupp.mapDomain_apply_of_injective` 

to make space for the more general lemma that doesn't assume injectivity.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 9, 2026
@b-mehta

b-mehta commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Your PR description says "since the latter is mathematically equivalent but stronger according to TC search." but this seems to be a reason not to do the change! In particular,

variable {M : Type*} [CommMonoid M] [Preorder M] [MulLeftMono M] in
#synth IsOrderedMonoid M

is false.

@mathlib-bors mathlib-bors Bot added the awaiting-requeue This PR was on the bors queue but came off after a build failure or other issue. label Sep 9, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Build failed:

  • ci (staging) / Post-CI job

Fix if necessary, and then someone with permission can run bors r+ or bors retry.

@mathlib-bors mathlib-bors Bot removed ready-to-merge This PR has been sent to bors. bors-staging This PR is currently being built by bors on the staging branch. labels Sep 9, 2026
@YaelDillies

Copy link
Copy Markdown
Contributor Author

Your PR description says "since the latter is mathematically equivalent but stronger according to TC search." but this seems to be a reason not to do the change! In particular,

variable {M : Type*} [CommMonoid M] [Preorder M] [MulLeftMono M] in
#synth IsOrderedMonoid M

is false.

You seem to disagree on what "stronger" means. I am claiming

variable {M : Type*} [CommMonoid M] [Preorder M] [MulLeftMono M] in
#synth IsOrderedMonoid M

fails while

variable {M : Type*} [CommMonoid M] [Preorder M] [IsOrderedMonoid M] in
#synth MulLeftMono M

works.

@YaelDillies

Copy link
Copy Markdown
Contributor Author

bors merge

@mathlib-bors mathlib-bors Bot added ready-to-merge This PR has been sent to bors. and removed awaiting-requeue This PR was on the bors queue but came off after a build failure or other issue. labels Sep 9, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
…neg (#43610)

Also replace `MulLeftMono` by `IsOrderedMonoid` in a bunch of lemmas about commutative monoids, since the latter is mathematically equivalent but stronger according to TC search.

## Moves

- `Finsupp.mapDomain_apply` -> `Finsupp.mapDomain_apply_of_injective` 

to make space for the more general lemma that doesn't assume injectivity.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 9, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(Data/Finsupp): support of mapDomain is image of support if nonneg [Merged by Bors] - feat(Data/Finsupp): support of mapDomain is image of support if nonneg Sep 9, 2026
@mathlib-bors mathlib-bors Bot closed this Sep 9, 2026
@mathlib-bors mathlib-bors Bot removed the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Sep 9, 2026
@YaelDillies
YaelDillies deleted the support_map_domain_of_nonneg branch September 9, 2026 16:16
@b-mehta

b-mehta commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Indeed, and that's why your justification doesn't quite make sense. Note that mathlib doesn't even have a constructor proving the equivalence you mention. Specifically, in an application where my type is unconditionally a Group with MulLeftMono, but only commutative under other conditions, there's no convenient way in mathlib at the moment to build the IsOrderedMonoid instance, and so it's more difficult to apply this theorem after this change :(

@YaelDillies

Copy link
Copy Markdown
Contributor Author

Bhavik's suggested constructors were merged in #43663.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants